package cn.jiawei.jsql.net.protocol.codec;

import cn.jiawei.jsql.net.protocol.packages.Packet;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;

/**
 * @author : willian fu
 * @version : 1.0
 * @date : 2020/12/18 0018 16:43
 */
public class PacketCodec {

    public static ByteBuf encode(Channel channel, byte[] data){
        ByteBuf buffer = channel.alloc().buffer();
        buffer.writeBytes(data);
        return buffer;
    }

    public static Packet decode(ByteBuf byteBuf){
        byte[] bytes = new byte[3];
        byteBuf.readBytes(bytes);
        return null;
    }
}
